import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;

import javax.swing.SwingConstants;
import javax.swing.JComboBox;
public class VueSaisiePeriodique extends Vue {
	
	private static final long serialVersionUID = 1L;
	private static final Object[] String = null;
	private JPanel contentPane;
	private JTextField textFieldIssn ;
	private JTextField textFieldNom;
	private JButton buttonEnreg;
	private JButton buttonAnnuler;
	
	public VueSaisiePeriodique(Controleur controleur) {
		super(controleur);
		
		
			setTitle("Enregistrement d'un nouveau periodique");
			//setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 
			setBounds(100, 100, 412, 193);
			contentPane = new JPanel();
			this.addWindowListener (new WindowAdapter() {
				public void windowClosing (WindowEvent e) {
				getControleur().fermerVue(VueSaisiePeriodique.this);
				}
			});
			contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
			setContentPane(contentPane);
			contentPane.setLayout(null);

			JLabel lblNewLabel = new JLabel("Issn");
			lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
			lblNewLabel.setBounds(0, 35, 61, 15);
			contentPane.add(lblNewLabel);
			
			textFieldIssn = new JTextField();
			textFieldIssn.setBounds(109, 32, 141, 19);
			contentPane.add(textFieldIssn);
			textFieldIssn.setColumns(10);
			
			JLabel lblNewLabel_1 = new JLabel("Nom");
			lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
			lblNewLabel_1.setBounds(0, 80, 61, 15);
			contentPane.add(lblNewLabel_1);
			
			textFieldNom = new JTextField();
			textFieldNom.setBounds(109, 77, 225, 19);
			contentPane.add(textFieldNom);
			textFieldNom.setColumns(10);


			
			
			
			
			buttonEnreg = new JButton("Enregistrer");
			buttonEnreg.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					String issn = textFieldIssn.getText();
					String nom = textFieldNom.getText();
				
					getControleur().nouvPeriodique(issn, nom);
					}
			});
			buttonEnreg.setBounds(109, 119, 119, 25);
			contentPane.add(buttonEnreg);
			
			buttonAnnuler = new JButton("Annuler");
			buttonAnnuler.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
				getControleur().fermerVue(VueSaisiePeriodique.this);}
			});
			buttonAnnuler.setBounds(238, 119, 96, 25);
			contentPane.add(buttonAnnuler);
			
			
			
			
			
	}

}
